//
//  LYLTimeLineCell_Empty.m
//  Diary
//
//  Created by lanou3g on 15/11/10.
//  Copyright © 2015年 王艺拓. All rights reserved.
//

#import "LYLTimeLineCell_Empty.h"

#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height

#define kDateLabelOriginX 0.01*kScreenWidth
#define kDateLabelOriginY 10
#define kDateLabelSizeW 0.14*kScreenWidth
#define kDateLabelSizeH 0.033*kScreenHeight
#define kSpace 10
#define kBaseImgOriginX 0.205*kScreenWidth
#define kBaseImgSizeW 0.775*kScreenWidth
#define kBaseImgSizeH 0.254*kScreenHeight
#define kTitleLabelOrigineX (0.025*kScreenWidth + kSpace)
#define kTitleLabelSizeH 0.254*kScreenHeight
#define kDiaryImgSizeW 0.375*kScreenWidth
#define kDiaryImgSizeH 0.154*kScreenHeight

@implementation LYLTimeLineCell_Empty

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self addSubViews];
    }
    return self;
}

- (void)addSubViews
{
    self.dateLabel = [[UILabel alloc] initWithFrame:CGRectMake(kDateLabelOriginX, kDateLabelOriginY, kDateLabelSizeW, kDateLabelSizeH)];
    self.dateLabel.layer.cornerRadius = 8.0;
    self.dateLabel.layer.masksToBounds = YES;
    self.dateLabel.textAlignment = NSTextAlignmentCenter;
    self.dateLabel.backgroundColor = [UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:0.500];
    self.dateLabel.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.dateLabel];
    
    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0.175*kScreenWidth, 0, 2, 0.283*kScreenHeight)];
    lineView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:lineView];
    
    self.dotImg = [[UIImageView alloc] initWithFrame:CGRectMake((0.175*kScreenWidth + 1 - 0.03*kScreenWidth/2), (kDateLabelOriginY + kDateLabelSizeH/2.0 - 0.03*kScreenWidth/2), 0.03*kScreenWidth, 0.03*kScreenWidth)];
    self.dotImg.backgroundColor = [UIColor whiteColor];
    self.dotImg.layer.cornerRadius = 0.03*kScreenWidth/2.0;
    self.dotImg.layer.masksToBounds = YES;
    [self.contentView addSubview:self.dotImg];
    
    self.baseImg = [[UIImageView alloc] initWithFrame:CGRectMake(kBaseImgOriginX, 0, kBaseImgSizeW, kBaseImgSizeH)];
    self.baseImg.layer.masksToBounds = UIViewContentModeScaleAspectFill;
    self.baseImg.layer.masksToBounds = YES;
    [self.contentView addSubview:self.baseImg];
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kTitleLabelOrigineX, 5, kBaseImgSizeW - kSpace - kTitleLabelOrigineX, kTitleLabelSizeH - 10)];
    self.titleLabel.font = [UIFont systemFontOfSize:14];
    self.titleLabel.numberOfLines = 0;
    [self.baseImg addSubview:self.titleLabel];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
